home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17526 < prev    next >
Encoding:
Text File  |  1996-08-05  |  747 b   |  46 lines

  1. Path: ix.netcom.com!news
  2. From: swampwiz@ix.netcom.com(Jean P. Laborde )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: A class with pointers to yet undeclared classes
  5. Date: 16 Apr 1996 00:56:19 GMT
  6. Organization: Netcom
  7. Message-ID: <4kur7j$c1e@dfw-ixnews6.ix.netcom.com>
  8. References: <4ksden$276@decaxp.HARVARD.EDU>
  9. NNTP-Posting-Host: nor-la1-08.ix.netcom.com
  10. X-NETCOM-Date: Mon Apr 15  7:56:19 PM CDT 1996
  11.  
  12. In <4ksden$276@decaxp.HARVARD.EDU> mueller@course1.HARVARD.EDU (Mark
  13. Mueller) writes: 
  14. >
  15. >How do I convince the compiler that class B is going to be declared
  16. later?
  17. >
  18. >  Mark
  19. >  mueller@fas.harvard.edu
  20. >
  21. >
  22.  
  23. before B is called, have the line 
  24.  
  25. class B;
  26.  
  27. ex:
  28.  
  29. class A
  30. {
  31.     B b;
  32. };
  33.  
  34. class B
  35. {
  36. ~~
  37. };
  38.  
  39. //  compile error 
  40.  
  41. now try:
  42.  
  43. class B;
  44.  
  45. in front. 
  46.